<script setup lang="ts">
import { ref } from 'vue'
import { emitter } from '@/utils/eventBus.js'
let flag = ref(false)
const emit = defineEmits(['on-click'])
const clickaaa = () => {
    console.log(flag)
    flag.value = !flag.value
    emit('on-click', flag.value)
}
const clickBBB = () => {
    flag.value = !flag.value
    emitter.emit('flag-meg', flag.value)
}
</script>
<template>
    <div class="A">我是A</div>
    <p>{{ flag }}</p>
    <n-button type="primary" @click="clickaaa">
        Tertiary
    </n-button>
    <n-button type="success" @click="clickBBB">
        Success
    </n-button>
</template>

<style scoped lang="scss">
.A {
    background: #00aeec;
    color: #fff;
    width: 200px;
    height: 200px;
}
</style>
